import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ParkOrderPayVO, ParkOrderPayForm, ParkOrderPayQuery } from '@/api/park/parkOrderPay/types';

/**
 * 查询订单支付列表
 * @param query
 * @returns {*}
 */

export const listParkOrderPay = (query?: ParkOrderPayQuery): AxiosPromise<ParkOrderPayVO[]> => {
  return request({
    url: '/park/parkOrderPay/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询订单支付详细
 * @param payId
 */
export const getParkOrderPay = (payId: string | number): AxiosPromise<ParkOrderPayVO> => {
  return request({
    url: '/park/parkOrderPay/' + payId,
    method: 'get'
  });
};

/**
 * 新增订单支付
 * @param data
 */
export const addParkOrderPay = (data: ParkOrderPayForm) => {
  return request({
    url: '/park/parkOrderPay',
    method: 'post',
    data: data
  });
};

/**
 * 修改订单支付
 * @param data
 */
export const updateParkOrderPay = (data: ParkOrderPayForm) => {
  return request({
    url: '/park/parkOrderPay',
    method: 'put',
    data: data
  });
};

/**
 * 删除订单支付
 * @param payId
 */
export const delParkOrderPay = (payId: string | number | Array<string | number>) => {
  return request({
    url: '/park/parkOrderPay/' + payId,
    method: 'delete'
  });
};
